﻿using UnityEngine;
using UnityEngine.UIElements;

namespace DA.AnimGraph.Editor {
    internal abstract class TrinityPaneBase : NonContextPaneBase {
        protected VisualElement leftContainer;
        protected VisualElement middleContainer;
        protected VisualElement rightContainer;

        public TrinityPaneBase(AGEEnvironment ageEnv) : base(ageEnv) {
            InitContainer();
        }
        public TrinityPaneBase(NonContextPaneBase parent) : base(parent) {
            InitContainer();
        }

        void InitContainer() {
            AGEGlobal.GetInstance().style.SS_Pane(this);
            style.flexDirection = FlexDirection.Row;
            style.justifyContent = Justify.Center; // 垂直居中

            leftContainer = new VisualElement() {
                name = "leftContainer",
                style = {
                    minWidth = 300,
                    flexDirection = FlexDirection.Column,
                }
            };
            middleContainer = new VisualElement() {
                name = "middleContainer",
                style = {
                    minWidth = 600,
                    flexDirection = FlexDirection.Column,
                    borderBottomWidth = 1,
                    borderLeftWidth = 1,
                    borderRightWidth = 1,
                    borderTopWidth = 1,
                    borderBottomColor = Color.black,
                    borderLeftColor = Color.black,
                    borderRightColor = Color.black,
                    borderTopColor = Color.black,
                }
            };
            rightContainer = new VisualElement() {
                name = "rightContainer",
                style = {
                    minWidth = 300,
                    flexDirection = FlexDirection.Column,
                }
            };
        }

    }
}
